<?php
/**
 * Created by PhpStorm.
 * User: lhuan
 * Date: 2019/11/7
 * Time: 20:08
 */
namespace app\index\controller;

use app\index\model\Article;
use app\index\model\ArticleClassify;
use app\index\model\Blogroll;
use app\index\model\Config;
use think\Controller;

class BlogLink extends Index
{
    public function index()
    {
        return ajax_return(200,'success',Blogroll::getBlogroll(true,input('param.search/a')));
    }

    public function add()
    {
        $add = Blogroll::add(input('param.'));
        if($add){
            return ajax_return(200,'success',$add);
        }else{
            return ajax_return(201,'error');
        }
    }

    public function modify()
    {
        $modify = Blogroll::modify(input('param.'));
        if($modify){
            return ajax_return(200,'success');
        }else{
            return ajax_return(201,'error');
        }
    }

    public function remove()
    {
        $remove = Blogroll::remove((int)input('param.id',false));
        if($remove){
            return ajax_return(200,'success');
        }else{
            return ajax_return(201,'error');
        }
    }
}